<?php

require_once('../include/GeneralTop.php');
require('../include/class/db.php');
require('../include/class/pagination.php');
require('../include/simpleHeader.php');

?>  
<body topmargin="0" leftmargin="0">
<table width="777" border="0" align="left" cellpadding="0" cellspacing="0" valign="top">
  <tr>
    <td width="777" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="51" valign="top" background="../images/fen_09.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="16">&nbsp;</td>
            </tr>
          </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="14"><img src="../images/fen_12.gif" width="7" height="29"></td>
              <td width="405"><span class="font_16px_black_B"><?php echo TEXT_INFO_ISSUE?></span></td>
              <td width="15">&nbsp;</td>
              <td width="299">&nbsp;</td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="1" bgcolor="#767676"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="font_12px_gray">
        <tr>
          <td valign="top" class="font_12px_gray">
          <table border="0" align="left" cellpadding="7" cellspacing="1" class="font_12px_gray">
        <tr>
          <td>&nbsp;</td>
          <td width="40%" class="font_12px_gray_h18"><strong><?php echo TEXT_SICK_TITLE?></strong></td>
          <td width="60%" align="center" class="font_12px_gray_h18"><strong><?php echo TEXT_SICK_INFO?></strong></td>
        </tr>
        <?php 
		$db = new db;
		$sql = "SELECT Id,pets_class,sickname,SUBSTRING(sickinfo,1,55) AS sickinfo FROM petssick where pets_class=".PET_SICK_CATDOG;
		$res = $db->query($sql);
		$num = $db->num($res);
		if($num > 0) {
			$pagination = new Pagination($num, PAGICATION_RECORD_COUNT_MAL, $_GET['page'], PAGINATION_DELTA);
			$sql = $sql." limit ".$pagination->begin.",".$pagination->end;
			$res = $db->query($sql);
			$i = 1;
			while($row = $db->fetch($res)) {
				if($i % 2 == 0) {
					$bgcolor = '#ffffff';
				}
				else {
					$bgcolor = '#eeeeee';
				}
				$i ++;
		?>
          <tr style="background:<?php echo $bgcolor?>">
            <td height="30" valign="middle">
              <img src="../images/fen_15.gif" width="10" height="11">&nbsp; </td>
            <td height="30"><a href="SickAdvisoryinfo.php?Id=<?php echo $row['Id']; ?>" class="gray_12px"><?php echo $row['sickname']; ?>&nbsp; </a></td>
            <td height="30" align="left"><?php echo $row['sickinfo']; ?>...&nbsp; </td>
          </tr>
        <?php 
          	}
		}
		?>
      <tr>
        <td colspan="5">
      <table border="0" align="left" cellpadding="0" cellspacing="5" class="font_12px_gray">
            <tr>
              <td>
              <?php
				if($num > PAGICATION_RECORD_COUNT_MAL) {
					echo $pagination->paginationString;
				}
				?>
              </td>
              </tr>
          </table>      </td></tr>
      
      <tr><td colspan="5">
      </td></tr>
      </table>      
          
          
          </td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>